package com.xs.designpattern;

/**
 * @author xs
 */
public class Main {
    public static void main(String[] args) {
              Unit commander = new Commander(new Sergeant(new Soldier(), new Soldier(), new Soldier()),new Sergeant(new Soldier(), new Soldier(), new Soldier()));
        commander.accept(new SoldierVisitor());
        commander.accept(new SergeantVisitor());
        commander.accept(new CommanderVisitor());
    }
}